using Aurora.TaskScheduler.Abstractions.BaseModel;

namespace Aurora.TaskScheduler.Storage.MySql;

public static class TaskSchedulerMysqlExtension
{
    /// <summary>
    /// 使用mysql 
    /// </summary>
    /// <param name="options"></param>
    /// <param name="configure"></param>
    /// <returns></returns>
    public static TaskSchedulerOptions UseMySql(this TaskSchedulerOptions options, Action<MySqlOptions> configure)
    {
        if (configure == null) throw new ArgumentNullException(nameof(configure));
        options.RegisterExtension(new MySqlTaskSchedulerOptionExtension(configure));
        return options;
    }
}